/**
 * 基础实体
 * @author webxue<xueshuai_12@163.com>
 * @date 2022-12-12
 */

import { PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from "typeorm";
import { ApiProperty } from "@nestjs/swagger";

export abstract class BaseEntity {
  @ApiProperty({ example: 1, description: "主键id" })
  @PrimaryGeneratedColumn({ comment: "主键id" })
  id: number;

  @ApiProperty({ example: "2022-12-01", description: "创建时间" })
  @CreateDateColumn({ comment: "创建时间" })
  create_time: Date | string;

  @ApiProperty({ example: "2022-12-01", description: "更新时间" })
  @UpdateDateColumn({ nullable: true, comment: "更新时间" })
  update_time: Date;
}
